import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 复检统计信息 */
export interface RecheckStatics {
          id: number; // 主键
          accountId?: number; // 模具台账id
          drawingNoId?: number; // 图号id
          recheckId: number; // 复检类型id
          recheckCounts: number; // 复检次数
          recheckTotalTime: number; // 复检工时
          status: number; // 任务状态
  }

// 复检统计 API
export const RecheckStaticsApi = {
  // 查询复检统计分页
  getRecheckStaticsPage: async (params: any) => {
    return await request.get({ url: `/mold/recheck-statics/page`, params })
  },

  // 查询复检统计详情
  getRecheckStatics: async (id: number) => {
    return await request.get({ url: `/mold/recheck-statics/get?id=` + id })
  },

  // 新增复检统计
  createRecheckStatics: async (data: RecheckStatics) => {
    return await request.post({ url: `/mold/recheck-statics/create`, data })
  },

  // 修改复检统计
  updateRecheckStatics: async (data: RecheckStatics) => {
    return await request.put({ url: `/mold/recheck-statics/update`, data })
  },

  // 删除复检统计
  deleteRecheckStatics: async (id: number) => {
    return await request.delete({ url: `/mold/recheck-statics/delete?id=` + id })
  },

  /** 批量删除复检统计 */
  deleteRecheckStaticsList: async (ids: number[]) => {
    return await request.delete({ url: `/mold/recheck-statics/delete-list?ids=${ids.join(',')}` })
  },

  // 导出复检统计 Excel
  exportRecheckStatics: async (params) => {
    return await request.download({ url: `/mold/recheck-statics/export-excel`, params })
  },
}